public class Square1 {
	public static void main(String[] args) {
		int count = 0;
		for (int i = 1;; i++) {
			if (Math.sqrt(i + 100) % 1 == 0) {
				if (Math.sqrt(i + 168) % 1 == 0) {
					System.out.print(i + " ");
					count++;
					break;
				}
			}
		}
	}

}
